// PGLNumbering.h: interface for the CPGLNumbering class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_PGLNUMBERING_H__AC2BB255_D774_419E_B0B3_E7B6B142B703__INCLUDED_)
#define AFX_PGLNUMBERING_H__AC2BB255_D774_419E_B0B3_E7B6B142B703__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <pgl/core/PGLObject.h>
#include <pgl/core/PGLText.h>

class CPGLNumbering : public CPGLObject  
{
PGL_DECLARE_DYNCREATE(CPGLNumbering);
public:
	//! Orientation of the numbering
	enum ESide
	{
		SideLeft,
		SideRight,
		SideBottom,
		SideTop
	};

	//! \name Constructors
	//@{
	explicit CPGLNumbering(ESide eSide = SideLeft);
	CPGLNumbering(const CPGLNumbering&);
	CPGLNumbering& operator=( const CPGLNumbering&);
	virtual ~CPGLNumbering(){};
	//@}

	/*! \brief Processes the limits

	\param dStart minimum of coordinate
	\param dEnd maximum of coordinate
	\param gfx graphic interface
	\return dStart new minimum
	\return dEnd new maximum
	*/
	virtual void ProcessLimits(
		double& dStart, 
		double& dEnd, 
		gfxinterface::CGfxInterface& gfx
		){};

	ESide GetSide() const				{	return m_eSide;};
	void SetSide(ESide eSide_)			{	m_eSide=eSide_;};
	const CPGLText& GetText() const		{	return m_text;};
	CPGLText& GetText()					{	return m_text;};

	bool IsHorizontal() const;
	virtual void ComputeExtent(CPGLRectD& r){};

	/*! \brief Compute the size of the numbering
	
	*/
	void PlotGfx(
		CPGLRectD const& region_rect_,
		CPGLRectD const& numbering_rect_,
		gfxinterface::CGfxInterface& gfx
		);

	//! \name Serialization and debugging
	//@{
	//! Serialization
	void SerializeXML( CPGLArchive& ar);
	#ifdef _DEBUG
		//! MFC Dump
		virtual void Dump( CDumpContext& dc ) const;
		//! MFC AssertValid
		virtual void AssertValid() const;    // Override
	#endif
	//@}

protected:
	ESide m_eSide;
	CPGLText m_text;
};

PGL_DECLARE_SMARTPTR( CPGLNumbering );

#endif // !defined(AFX_PGLNUMBERING_H__AC2BB255_D774_419E_B0B3_E7B6B142B703__INCLUDED_)
